﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
using PickExperts2.form;

namespace PickExperts2.Class
{
    public class main
    {
        public static string iniFPath = Application.StartupPath + @"\option.ini";
        public static string homePage = "http://www.kaloja.com";
        public static string taobao图表 = "http://taobao.starlott.com/ssq/jb.html";
        public static string wubai图表 = "http://datachart.500wan.com/ssq/zoushi/jbzs_redblue.shtml";
        public static string fucai图表 = "http://tb.zhcw.com/ssq/556260.shtml";
        public static string taobao代购 = "http://caipiao.taobao.com/lottery/order/lottery_ssq.htm";
        public static string wubai代购 = "http://trade.500wan.com/ssq/";
        private Thread waitThread;
        private fmWait waitForm;

        public Form showFormInTab(TabControl krbTab, Form fm, string title)
        {
            TabPage tpe = new TabPage();
            tpe.Text = title;
            tpe.Enabled = true;
            fm.Text = title;
            fm.TopLevel = false;
            fm.Dock = DockStyle.Fill;
            fm.FormBorderStyle = FormBorderStyle.None;
            tpe.Controls.Add(fm);
            //tpe.BackColor = Color.CornflowerBlue;
            fm.Show();
            krbTab.TabPages.Add(tpe);
            krbTab.SelectTab(tpe);
            return fm;
        }

        public void showWaitForm()
        {
            waitThread = new Thread(new ThreadStart(delegate()
            {
                waitForm = new fmWait();
                Application.Run(waitForm);
            }));
            waitThread.Start();
        }

        public void closeWaitForm()
        {
            if (waitThread != null)
            {
                try
                {
                    waitThread.Abort();
                }
                catch (Exception)
                {
                    //throw;
                }
            }
        }
    }
}
